<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>{$title}</title>
    <link rel="shortcut icon" href="__STATIC__/src/common/img/cauliflower-small.png" type="image/x-icon" />
    <link rel="stylesheet" type="text/css"  href="__STATIC__/src/common/css/bootstrap.css" />
    <link rel="stylesheet" type="text/css"  href="__STATIC__/src/common/css/common.css" />
    <link rel="stylesheet" type="text/css"  href="__STATIC__/src/common/css/mobiscroll.min.css" />
</head>
<body>
{include file="common/header"}
<div class="container">
    <div class="row">
        <div class="col-md-8 col-md-offset-2 {$cleanAlert}">
            <div class="alert alert-warning">
                考试已被清理，可以<a href='{:url("deleteOneExam")}'>删除考试</a>！
            </div>
        </div>
        <div class="col-md-8 col-md-offset-2 {$content}">
            <div class="panel panel-default">
                <div class="panel-heading">
                    考试管理
                </div>
                <div class="panel-body">
                    <div>
                        当前考试状态为：
                        {if condition="$exam.status == 0"}
                        <strong>未开始</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='{:url("startExam?examName=$examName")}' class="btn btn-primary">开始考试</a>
                        {elseif condition="$exam.status == 1"/}
                        <strong>正在进行中</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='{:url("stopExam?examName=$examName")}' class="btn btn-primary">结束考试</a>
                        {elseif condition="$exam.status == 2"/}
                        <strong>已结束</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="btn btn-primary" href='{:url("cleanExam")}'>清理考试</a>
                        {else /}
                        {/if}
                    </div>
                    <div style="text-align: center; margin-top: 20px;">
                        <strong>考试详情</strong>
                    </div>
                    <table class="table table-striped table-hover table-bordered">
                        <tr>
                            <th>报考人数</th>
                            <th>已登录/未登录</th>
                            <th>已提交/未提交</th>
                        </tr>
                        <tr>
                            <td><span class="normal-fontSize">{$total}</span></td>
                            <td><a href='{:url("showLogin?examName=$examName")}' class="hint normal-fontSize">{$login}/{$not_login}</a></td>
                            <td><a href='{:url("showSubmit?examName=$examName")}' class="hint normal-fontSize">{$submit}/{$not_submit}</a></td>
                        </tr>
                    </table>
                    <div>
                        通知管理：<a style="font-weight: bold;" href='{:url("notify")}'>通知详情</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a style="font-weight: bold;" href='{:url("addNotify")}'>添加通知</a>
                    </div>
                    <div style="margin-top: 20px;">
                        答卷管理：<a style="font-weight: bold;" href='{:url("xzAnswer")}'>答卷下载</a>
                    </div>
                </div>
            </div>
            <div class="panel panel-default">
                <div class="panel-heading">
                    考试信息修改
                </div>
                <div class="panel-body">
                    <div class="">
                        <div class="">
                            <div class="">
                                <form class="form-horizontal" action='{:url("modifyExam?oldExamName=$examName")}' method="post">
                                    <div class="form-group">
                                        <label for="examName" class="col-md-2 control-label">考试名称：</label>
                                        <div class="col-md-10">
                                            <input type="text" class="form-control" name="examName" id="examName" placeholder="请输入教室名称" value="{$exam.exam_name}">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="startTime" class="col-md-2 control-label">考试开始时间：</label>
                                        <div class="col-md-10">
                                            <input class="form-control" id="startTime" name="startTime" type="text" readonly="readonly" value="{:substr($exam.exam_startTime,0,-3)}">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="examDuration" class="col-md-2 control-label">考试时长：</label>
                                        <div class="col-md-10">
                                            <div class="input-group">
                                                <input type="text" name="examDuration" id="examDuration" class="form-control" placeholder="请输入考试分钟数" value="{$exam.exam_duration}">
                                                <span class="input-group-addon">分钟</span>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-md-2 control-label">是否自动开始：</label>
                                        <div class="col-md-10">
                                            <input type="radio" value="yes" name="isAutoStart" {if condition="$exam.exam_autoStart==1"} checked="checked" {/if}>是
                                            <input type="radio" value="no" name="isAutoStart" {if condition="$exam.exam_autoStart==0"} checked="checked" {/if}>否
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="attention" class="col-md-2 control-label">考试注意事项：</label>
                                        <div class="col-md-10">
                                            <textarea class="form-control big-fontSize" placeholder="请输入考试注意事项" id="attention" name="attention" style="resize: none; height: 200px;">{$exam.attention_matters}</textarea>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-md-10 col-md-offset-2">
                                            <button type="submit" class="btn btn-primary">保存修改</button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="__STATIC__/src/common/js/jquery-3.2.1.js"></script>
<script src="__STATIC__/src/common/js/bootstrap.js"></script>
<script src="__STATIC__/src/common/js/mobiscroll.min.js"></script>
<script>
    $(function () {
        var currYear = (new Date()).getFullYear();
        var opt={};
        opt.datetime = {preset : 'datetime'};
        opt.default = {
            theme: 'android-ics light', //皮肤样式
            display: 'modal', //显示方式
            mode: 'scroller', //日期选择模式
            dateFormat: 'yyyy-mm-dd',
            lang: 'zh',
            showNow: true,
            nowText: "今天",
            startYear: currYear, //开始年份
            endYear: currYear + 10 //结束年份
        };
        var optDateTime = $.extend(opt['datetime'], opt['default']);
        $("#startTime").mobiscroll(optDateTime).datetime(optDateTime);
    });
</script>
</body>
</html>